#!/bin/sh
#
# $FreeBSD$
#
# I want to rewrite this in python. That is all.
#

# PROVIDE: ix-kinit
# REQUIRE: kdc
# REQUIRE: ix-pre-samba
# REQUIRE: ntpd

. /etc/rc.freenas

kerberos_start()
{
	LD_LIBRARY_PATH=/usr/local/lib /usr/local/bin/midclt call kerberos.start > /dev/null
}

kerberos_status()
{
	LD_LIBRARY_PATH=/usr/local/lib /usr/local/bin/midclt call kerberos.status > /dev/null
}

kerberos_stop()
{
	LD_LIBRARY_PATH=/usr/local/lib /usr/local/bin/midclt call kerberos.stop > /dev/null
}

kerberos_renew()
{
	LD_LIBRARY_PATH=/usr/local/lib /usr/local/bin/midclt call kerberos.renew > /dev/null
}

name="ix-kinit"
start_cmd='kerberos_start'
status_cmd='kerberos_status'
stop_cmd='kerberos_stop'
renew_cmd="kerberos_renew"
extra_commands="renew"

load_rc_config $name
run_rc_command "$1"
